/*
 * @Copyright: 2017 www.yyfax.com Inc. All rights reserved.
 */
package com.yyfax.pay.config.model.to;

import org.apache.commons.lang3.StringUtils;

import com.yyfax.framework.exception.YYException;
import com.yyfax.framework.model.Params;
import com.yyfax.framework.yyfax.enums.RspCodeEnum;


/**
 * 更新商户信息传入参数
 * @author changxd
 * @date 2017-04-13
 * @since 1.0.0
 */
@SuppressWarnings("serial")
public class MerchantConfigSaveParams extends Params {

	/** 商户编号 mechant_code */
	private String merchantCode;
	/** 商户名称 name */
	private String name;
	/** 签名密钥 sign_key */
	private String signKey;
	/** 生效时间 start_time */
	private String startTime;
	/** 失效时间 end_time */
	private String endTime;
	/** 白名单信息IP,用逗号分隔开, trust_list */
	private String trustList;
	/** 备注 remark */
	private String remark;
	/** 状态 state */
	private String state;
	/** 创建时间 */
	private String createTime;

	@Override
	public boolean validate() throws Exception {

		if (StringUtils.isBlank(merchantCode)) {
			throw new YYException(RspCodeEnum.COMMON_ERROR_PARAMETER_INVALID, "参数 'mechantCode'不能为空");
		}
		if (StringUtils.isBlank(name)) {
			throw new YYException(RspCodeEnum.COMMON_ERROR_PARAMETER_INVALID, "参数 'name'不能为空");
		}
		if (StringUtils.isBlank(signKey)) {
			throw new YYException(RspCodeEnum.COMMON_ERROR_PARAMETER_INVALID, "参数 'signKey'不能为空");
		}
		if (StringUtils.isBlank(startTime)) {
			throw new YYException(RspCodeEnum.COMMON_ERROR_PARAMETER_INVALID, "参数 'startTime'不能为空");
		}
		if (StringUtils.isBlank(endTime)) {
			throw new YYException(RspCodeEnum.COMMON_ERROR_PARAMETER_INVALID, "参数 'endTime'不能为空");
		}
		if (StringUtils.isBlank(trustList)) {
			throw new YYException(RspCodeEnum.COMMON_ERROR_PARAMETER_INVALID, "参数 'trustList'不能为空");
		}
		if (StringUtils.isBlank(remark)) {
			throw new YYException(RspCodeEnum.COMMON_ERROR_PARAMETER_INVALID, "参数 'remark'不能为空");
		}
		if (StringUtils.isBlank(state)) {
			throw new YYException(RspCodeEnum.COMMON_ERROR_PARAMETER_INVALID, "参数 'state'不能为空");
		}
		return true;
	}

	public String getMerchantCode() {
		return merchantCode;
	}

	public void setMerchantCode(String merchantCode) {
		this.merchantCode = merchantCode;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getSignKey() {
		return signKey;
	}

	public void setSignKey(String signKey) {
		this.signKey = signKey;
	}

	public String getStartTime() {
		return startTime;
	}

	public void setStartTime(String startTime) {
		this.startTime = startTime;
	}

	public String getEndTime() {
		return endTime;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}

	public String getTrustList() {
		return trustList;
	}

	public void setTrustList(String trustList) {
		this.trustList = trustList;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public String getCreateTime() {
		return createTime;
	}

	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}

}
